package top.minuy.structure.graph.cc.directed;

import top.minuy.res.graph.GraphRes;
import top.minuy.structure.graph.representations.table.Graph;

import java.util.ArrayList;

/**
 * 测试强联通分量，Kosaraju算法
 *
 * @author Minuy
 * @time 20:15
 * @date 2021/11/27
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("G1：");
       t(GraphRes.G_SCC_01);
        System.out.println("G2：");
        t(GraphRes.G_SCC_02);
        System.out.println("G3：");
        t(GraphRes.G_SCC_03);
    }
    static void t(String path){
        Graph g = new Graph(path,true);
        SCC scc = new SCC(g);
        System.out.println("count : "+scc.count());
        int i = 0;
        for (ArrayList<Integer> ins:scc.components()){
            System.out.println("SCC_ID : "+i+" -> "+ins);
            i++;
        }
    }
}
